<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/salesinfo/sales_contract_inventory/q_sales_contract_inventory.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/salesinfo/sales_contract_inventory/q_sales_contract_inventory.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'ID',
                footer: "Foots",
                cnName: '合同未销商品库存',
                name: 'sales_contract_inventory/q_sales_contract_inventory',
                url: "/q_sales_contract_inventory/",
                sortName: "合同,编码,入库时间"
            });
            const editFormFields = ref({});
            const editFormOptions = ref([]);
            const searchFormFields = ref({"库位":"","合同":"","合同价格":[null,null],"未销数量":[null,null],"编码":"","名称":"","可用数量":[null,null],"入库时间":""});
            const searchFormOptions = ref([[{"title":"合同","field":"合同","type":"like"},{"title":"合同价格","field":"合同价格","type":"range"},{"dataKey":"库位编码","data":[],"title":"库位","field":"库位","type":"select"},{"title":"合同未销数量","field":"未销数量","type":"range"}],[{"title":"编码","field":"编码","type":"like"},{"title":"名称","field":"名称","type":"like"},{"title":"可用数量","field":"可用数量","type":"range"},{"title":"入库时间","field":"入库时间","type":"date"}]]);
            const columns = ref([{field:'库位',title:'库位',type:'string',bind:{ key:'库位编码',data:[]},width:120,align:'left',sort:true},
                       {field:'合同',title:'合同',type:'string',width:180,align:'left'},
                       {field:'合同价格',title:'合同价格',type:'decimal',width:110,align:'left'},
                       {field:'合同金额',title:'合同金额',type:'decimal',width:110,align:'left'},
                       {field:'合同数量',title:'合同数量',type:'float',width:110,align:'left'},
                       {field:'未销数量',title:'合同未销数量',type:'float',width:110,align:'left'},
                       {field:'编码',title:'编码',type:'string',width:110,align:'left'},
                       {field:'名称',title:'名称',type:'string',width:220,align:'left'},
                       {field:'可用数量',title:'可用数量',type:'float',width:110,align:'left'},
                       {field:'成本价',title:'成本价',type:'decimal',width:110,align:'left'},
                       {field:'入库时间',title:'入库时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'单号ID',title:'单号ID',type:'guid',width:110,hidden:true,align:'left'},
                       {field:'库存ID',title:'库存ID',type:'guid',width:110,hidden:true,align:'left'},
                       {field:'ID',title:'ID',type:'guid',width:110,hidden:true,require:true,align:'left'},
                       {field:'无税单价',title:'无税单价',type:'decimal',width:110,align:'left'},
                       {field:'无税总价',title:'无税总价',type:'decimal',width:110,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
